﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Shared/Site.Master" AutoEventWireup="true"
    CodeBehind="NhomPhanQuyen.aspx.cs" Inherits="Hotel_Admin.NhomPhanQuyen" %>

<%@ Register Assembly="Hotel.Controls" Namespace="Hotel.Controls" TagPrefix="hotel" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
        
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div class="crmcontainer">
        <asp:UpdatePanel runat="server" ID="upInfor" UpdateMode="Conditional">
            <ContentTemplate>
                <table class="crmtable">
                    <tr>
                        <td class="crmcell right">
                            Mã nhóm
                        </td>
                        <td>
                            <asp:TextBox ID="txtMaNhom" runat="server"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td class="crmcell right">
                            Tên nhóm
                        </td>
                        <td>
                            <asp:TextBox ID="txtTenNhóm" runat="server"></asp:TextBox>
                        </td>
                    </tr>
                </table>
            </ContentTemplate>
        </asp:UpdatePanel>
        <asp:UpdatePanel runat="server" ID="upNhomNguoiDung" UpdateMode="Conditional">
            <ContentTemplate>
                <hotel:Grid ID="gvList" runat="server" UseCustomPager="true" OnRowCommand="gvList_RowCommand">
                    <PagerSettings FirstPageText="nhóm người dùng " PageButtonCount="2" />
                    <Columns>
                        <asp:TemplateField HeaderText="Mã nhóm người dùng" HeaderStyle-Width="18%">
                            <ItemTemplate>
                                <asp:LinkButton ID="lnkBtnID" runat="server" CommandArgument='<%# Eval("Id") %>'
                                    CommandName="EditItem" CssClass="link" Text='<%# Eval("Id") %>'></asp:LinkButton>
                            </ItemTemplate>
                            <ItemStyle Font-Bold="True" />
                        </asp:TemplateField>
                        <asp:BoundField DataField="Name" HeaderText="Tên nhóm người dùng" />
                    </Columns>
                </hotel:Grid>
            </ContentTemplate>
        </asp:UpdatePanel>
        <asp:UpdatePanel runat="server" ID="upGird" UpdateMode="Conditional">
            <ContentTemplate>
                <div class="crmcontainer" runat="server" id="divgrPer" visible="false">
                    <table style="width: 100%; text-align: right">
                        <tr>
                            <td class="crmcell right">
                                &nbsp;
                            </td>
                            <td>
                                <asp:Button ID="btnSave" CssClass="btnGui" Text="Lưu" runat="server" OnClick="btnSave_Click" />
                                <asp:Button ID="btnHuy" CssClass="btnGui" Text="Hủy" runat="server" OnClick="btnHuy_Click" />
                            </td>
                        </tr>
                    </table>
                    <hotel:Grid ID="grdPermission" runat="server" PageSize="1000" ShowFooter="True" OnRowDataBound="grdPermission_RowDataBound">
                        <PagerSettings FirstPageText="chức năng" PageButtonCount="2" />
                        <Columns>
                            <asp:TemplateField HeaderStyle-CssClass="checkbox">
                                <ItemTemplate>
                                    <input id="chkFunctionId" onclick="CheckAllInRow(this);" runat="server" type="checkbox"
                                        value='<%# Eval("PageId") %>' />
                                        <asp:HiddenField runat="server" ID="hdPageId" Value='<%# Eval("PageId") %>' />
                                </ItemTemplate>
                                <FooterTemplate>
                                    <img src="../../content/images/common/arrow.png" />
                                </FooterTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Tên trang">
                                <ItemTemplate>
                                    <%# Eval("Name") %>
                                </ItemTemplate>
                                <ItemStyle Font-Bold="True" />
                                <HeaderStyle Width="78%" HorizontalAlign="Left" />
                                <FooterTemplate>
                                    <a href="#" onclick="SelectAll('chkFunctionId,chkRead,chkInsert,chkUpdate,chkDelete', true); return false;">
                                        <strong>Chọn hết</strong></a> / <a href="#" onclick="SelectAll('chkFunctionId,chkRead,chkInsert,chkUpdate,chkDelete', false); return false;">
                                            <strong>Bỏ chọn hết</strong></a>
                                </FooterTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Xem">
                                <ItemTemplate>
                                    <input id="chkRead" runat="server" onclick="UpdateRowState(this,'chkFunctionId',1);"
                                        type="checkbox" value="1" />
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Center" />
                                <HeaderStyle Width="5%" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Thêm">
                                <ItemTemplate>
                                    <input id="chkInsert" runat="server" onclick="UpdateRowState(this,'chkFunctionId',1);"
                                        type="checkbox" value="2" />
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Center" />
                                <HeaderStyle Width="5%" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Sửa">
                                <ItemTemplate>
                                    <input id="chkUpdate" runat="server" onclick="UpdateRowState(this,'chkFunctionId',1);"
                                        type="checkbox" value="3" />
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Center" />
                                <HeaderStyle Width="5%" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Xóa">
                                <ItemTemplate>
                                    <input id="chkDelete" runat="server" onclick="UpdateRowState(this,'chkFunctionId',1);"
                                        type="checkbox" value="4" />
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Center" />
                                <HeaderStyle Width="5%" />
                            </asp:TemplateField>
                        </Columns>
                    </hotel:Grid>
                    <table style="width: 100%; text-align: right">
                        <tr>
                            <td class="crmcell right">
                                &nbsp;
                            </td>
                            <td>
                                <asp:Button ID="Button1" CssClass="btnGui" Text="Lưu" runat="server" OnClick="btnSave_Click" />
                                <asp:Button ID="Button2" CssClass="btnGui" Text="Hủy" runat="server" OnClick="btnHuy_Click" />
                            </td>
                        </tr>
                    </table>
                </div>
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
</asp:Content>
